/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'
import ModuleLayout from '@/layout/module'

const financeRouter = {
  path: '/finance',
  component: Layout,
  redirect: '/finance/index',
  name: 'Finance',
  meta: {
    title: '财务',
    icon: 'finance',
    roles: ['admin', 'shop', 'accountant']
  },
  children: [
    {
      path: '/finance/index',
      component: () => import('@/views/finance/index'),
      name: 'financeIndex',
      meta: {
        title: '概述统计',
        icon: 'em-icon-finance'
      }
    },
    {
      path: '/finance/trade',
      redirect: '/finance/trade/index',
      component: ModuleLayout,
      meta: {
        title: '交易记录',
        icon: 'em-icon-sponsor'
      },
      children: [
        {
          path: '/finance/trade/index',
          component: () => import('@/views/trade/default/index'),
          meta: {
            title: '列表',
            keepAlive: true
          },
          hidden: true
        },
        {
          path: '/finance/trade/view/:id',
          component: () => import('@/views/trade/default/view'),
          name: 'finance/trade/view/:id',
          meta: {
            title: '详情'
          },
          hidden: true
        }
      ]
    }
  ]
}
export default financeRouter
